package services;

import domain.entities.ProtocolLevelDocumentation;
import domain.entities.ProtocolLevelDocumentationDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Guillermo
 * Date: 12/09/12
 * Time: 11:54
 * To change this template use File | Settings | File Templates.
 */
@Service
public class ProtocolLevelDocumentationService {

    private ProtocolLevelDocumentationDAO protocolLevelDocumentationDAO;

    public ProtocolLevelDocumentationService() {
    }

    @Autowired
    public ProtocolLevelDocumentationService(ProtocolLevelDocumentationDAO protocolLevelDocumentationDAO) {
        this.protocolLevelDocumentationDAO = protocolLevelDocumentationDAO;
    }

    public void save(ProtocolLevelDocumentation protocolLevelDocumentation){
        protocolLevelDocumentationDAO.attachDirty(protocolLevelDocumentation);
    }

    public void delete(ProtocolLevelDocumentation protocolLevelDocumentation){
        protocolLevelDocumentationDAO.delete(protocolLevelDocumentation);
    }

    public  ProtocolLevelDocumentation findById(Integer id){
        return  protocolLevelDocumentationDAO.findById(id);
    }

    public List<ProtocolLevelDocumentation> findByProtocoloId(String protocoloid, Integer compromisopaisId){
        return protocolLevelDocumentationDAO.findByProtocoloId(protocoloid, compromisopaisId);

    }

}
